package filter;

import javax.servlet.*;
import java.io.IOException;

public class LogfIlter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
//        获得初始化参数
        String site = filterConfig.getInitParameter("site");

//        输出初始化参数
        System.out.println("网络站名："+site);
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        输出站点名称
        System.out.println("站点网址：http：www.baidu.com");

//        把请求传回给过滤连
        filterChain.doFilter(servletRequest, servletResponse);
    }

    @Override
    public void destroy() {

    }
}
